package com.ant.storage.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("inventory_check")
@ApiModel(value="库存盘点对象")
public class InventoryCheck {

    @TableId(value = "inventory_check_id", type = IdType.AUTO)
    private Integer inventory_check_id;

    @ApiModelProperty(value = "盘点时间")
    @TableField("inventory_check_time")
    private String inventory_check_time;

    @NotNull(message = "城市id为空")
    @Min(value = 1, message = "请填写正确的数字")
    @ApiModelProperty(value = "城市id")
    @TableField("city_id")
    private Integer city_id;

    @NotNull(message = "部门id为空")
    @Min(value = 1, message = "请填写正确的数字")
    @ApiModelProperty(value = "部门id")
    @TableField("dept_id")
    private Integer dept_id;

    @NotBlank( message = "盘点操作人不能为空")
    @ApiModelProperty(value = "盘点操作人")
    @TableField("inventory_check_staff")
    private String inventory_check_staff;

    @NotNull(message = "总差异金额为空")
    @DecimalMax(value = "100000.00",message = "差异金额最大为100000.00")
    @DecimalMin(value = "-100000.00",message = "差异金额最小为-100000.00")
    @Digits(integer = 6,fraction = 2,message = "请输入正确的差异金额")
    @ApiModelProperty(value = "总差异金额")
    @TableField("inventory_check_money")
    private BigDecimal inventory_check_money;

    @ApiModelProperty(value = "状态(1:盘点中 2:盘点完成)")
    @TableField("inventory_check_type")
    private Integer inventory_check_type;

    @ApiModelProperty(value = "备注")
    @TableField("inventory_check_remarks")
    private String inventory_check_remarks;

    @NotEmpty(message = "盘点货物不能为空")
    @TableField(exist = false)
    @ApiModelProperty(value = "商品")
    private List<InventoryCheckCommodity> list;

    @TableField(exist = false)
    @ApiModelProperty(value = "开始时间")
    private String start_time;

    @TableField(exist = false)
    @ApiModelProperty(value = "结束时间")
    private String end_time;

    @TableField(exist = false)
    private City city;

    @TableField(exist = false)
    private City dept;

}
